package com.dianping.cat.alarm.policy.entity;

import com.dianping.cat.alarm.policy.BaseEntity;
import com.dianping.cat.alarm.policy.IVisitor;
import java.util.LinkedHashMap;
import java.util.Map;

public class AlertPolicy
  extends BaseEntity<AlertPolicy> {
/* 10 */   private Map<String, Type> m_types = new LinkedHashMap();






/* 17 */   public void accept(IVisitor visitor) { visitor.visitAlertPolicy(this); }


  public AlertPolicy addType(Type type) {
/* 21 */     this.m_types.put(type.getId(), type);
/* 22 */     return this;
  }


  public boolean equals(Object obj) {
/* 27 */     if (obj instanceof AlertPolicy) {
/* 28 */       AlertPolicy _o = (AlertPolicy)obj;

/* 30 */       if (!equals(getTypes(), _o.getTypes())) {
/* 31 */         return false;
      }


/* 35 */       return true;
    }

/* 38 */     return false;
  }


/* 42 */   public Type findType(String id) { return (Type)this.m_types.get(id); }


  public Type findOrCreateType(String id) {
/* 46 */     Type type = (Type)this.m_types.get(id);

/* 48 */     if (type == null) {
/* 49 */       synchronized (this.m_types) {
/* 50 */         type = (Type)this.m_types.get(id);

/* 52 */         if (type == null) {
/* 53 */           type = new Type(id);
/* 54 */           this.m_types.put(id, type);
        }
      }
    }

/* 59 */     return type;
  }


/* 63 */   public Map<String, Type> getTypes() { return this.m_types; }



  public void mergeAttributes(AlertPolicy other) {}



/* 80 */   public Type removeType(String id) { return (Type)this.m_types.remove(id); }
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-alarm-3.0.0.jar!/com/dianping/cat/alarm/policy/entity/AlertPolicy.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */